package com.myiam.idm.meta.model;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.MappedSuperclass;
import javax.persistence.PrePersist;
import javax.persistence.PreUpdate;
import javax.persistence.Transient;


@MappedSuperclass
public class MmBase implements Serializable {
	
	

	/**
	 * 
	 */
	@Transient
	private static final long serialVersionUID = 5350488527468159507L;

	public MmBase() {
		super();
	}
	

	@Column
	private AuditFields auditFields = new AuditFields();
	
	@PrePersist
	public void onCreate() {
		auditFields.setCreateDate(new Date());
		auditFields.setModifiedDate(new Date());
	}
	
	@PreUpdate
	public void onUpdate() {
		auditFields.setModifiedDate(new Date());
	}
	public AuditFields getAuditFields() {
		return auditFields;
	}
	

}